#include <iostream>
#include <cmath>
using namespace std;

int arr[1024][1024];
int power(int base, int exponent) {
    int result = 1;
    for (int i = 0; i < exponent; ++i) {
        result *= base;
    }
    return result;
}

void pardon(int side,int width_point,int height_point){
  if(side<2) return;
  for (int i = width_point; i < width_point+ side / 2; i++){
    for (int j = height_point; j <height_point+ side / 2; j++){
      arr[i][j] = 0;
    }
  }
  pardon( side/2, width_point + side / 2 , height_point           );
  pardon( side/2, width_point ,            height_point + side / 2);
  pardon( side/2, width_point + side / 2 , height_point + side / 2);
}

int main(){
  for(int i=0;i<1024;i++){
  	for(int j=0;j<1024;j++){
	  	arr[i][j]=1;
	}
  }
  int v;
  cin >> v;
  pardon( power(2,v), 0, 0);
  for(int i=0;i<power(2,v);i++){
    for(int j=0;j<power(2,v);j++){
  	  cout << arr[i][j] << " ";
    }
    cout << endl;
  }
}
